package com.ruoyi.detailed.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.detailed.mapper.DetailedMapper;
import com.ruoyi.detailed.domain.Detailed;
import com.ruoyi.detailed.service.IDetailedService;

/**
 * 积分明细查询Service业务层处理
 * 
 * @author 秦永昆
 * @date 2023-02-12
 */
@Service
public class DetailedServiceImpl implements IDetailedService 
{
    @Autowired
    private DetailedMapper detailedMapper;

    /**
     * 查询积分明细查询
     * 
     * @param detailedId 积分明细查询主键
     * @return 积分明细查询
     */
    @Override
    public Detailed selectDetailedByDetailedId(Long detailedId)
    {
        return detailedMapper.selectDetailedByDetailedId(detailedId);
    }

    /**
     * 查询积分明细查询列表
     * 
     * @param detailed 积分明细查询
     * @return 积分明细查询
     */
    @Override
    public List<Detailed> selectDetailedList(Detailed detailed)
    {
        return detailedMapper.selectDetailedList(detailed);
    }
    /**
     * 查询积分明细查询列表
     *
     * @param detailed 积分明细查询
     * @return 积分明细查询
     */
    @Override
    public List<Detailed> listUserDetailed(Detailed detailed)
    {
        detailed.setUserName(SecurityUtils.getUsername());
        return detailedMapper.listUserDetailed(detailed);
    }

    /**
     * 新增积分明细查询
     * 
     * @param detailed 积分明细查询
     * @return 结果
     */
    @Override
    public int insertDetailed(Detailed detailed)
    {
        detailed.setCreateTime(DateUtils.getNowDate());
        return detailedMapper.insertDetailed(detailed);
    }

    /**
     * 修改积分明细查询
     * 
     * @param detailed 积分明细查询
     * @return 结果
     */
    @Override
    public int updateDetailed(Detailed detailed)
    {
        detailed.setUpdateTime(DateUtils.getNowDate());
        return detailedMapper.updateDetailed(detailed);
    }

    /**
     * 批量删除积分明细查询
     * 
     * @param detailedIds 需要删除的积分明细查询主键
     * @return 结果
     */
    @Override
    public int deleteDetailedByDetailedIds(Long[] detailedIds)
    {
        return detailedMapper.deleteDetailedByDetailedIds(detailedIds);
    }

    /**
     * 删除积分明细查询信息
     * 
     * @param detailedId 积分明细查询主键
     * @return 结果
     */
    @Override
    public int deleteDetailedByDetailedId(Long detailedId)
    {
        return detailedMapper.deleteDetailedByDetailedId(detailedId);
    }
}
